//
//  ChannelLabel.m
//  
//
//  Created by admin on 17/2/28.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "ChannelLabel.h"

@implementation ChannelLabel

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        // 字号
        self.font = [UIFont systemFontOfSize:18.0];
        // 文字居中
        self.textAlignment = NSTextAlignmentCenter;
        
    }
    
    return self;
}
- (void)setScale:(CGFloat)scale {
    
    _scale = scale;
//    NSLog(@"scale = %f", scale);
    // 文字颜色渐变 #define defaultColor RGBColor(64/255, 181, 116)
    self.textColor = [UIColor colorWithRed:64/255 green:scale*181 /255  blue:116/255 alpha:1.0];
    NSLog(@"self.textColor = %@", self.textColor);
    
//    // 控件缩放 : 0表示缩放到没有;1表示原始状态;1+表示变大;(要缩放必须缩放比的取值在1.0~1.2)
//    CGFloat minScale = 1.0;
//    CGFloat maxScale = 1.2;
//    // 必须把scale经过处理,保证范围是1.0~1.2
//    scale = minScale + (maxScale - minScale) * scale;
//    // X和Y轴上的缩放最少是1.0
//    self.transform = CGAffineTransformMakeScale(scale, scale);

}
@end
